summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Keller <rainer.keller@nokia.com>2011-12-14 08:27:40 +0100
committerRainer Keller <rainer.keller@nokia.com>2011-12-14 08:28:20 +0100
commit09270fd0fd8bcce7061ab4af1532061fb82c892a (patch)
treeba79b877a4514a74cfb7a9db7de7042a6f1fc88b
parent159d7e289f70f920311fa8f05f4fbf3d1e196e8c (diff)
Fix example application
-rw-r--r--doc/example/application/exampleapp.cpp7
-rw-r--r--doc/example/application/exampleapp.h3
2 files changed, 3 insertions, 7 deletions
diff --git a/doc/example/application/exampleapp.cpp b/doc/example/application/exampleapp.cpp
index 97bae09..527bdd5 100644
--- a/doc/example/application/exampleapp.cpp
+++ b/doc/example/application/exampleapp.cpp
@@ -44,6 +44,7 @@
#include <QDebug>
#include <QtGui/QLineEdit>
#include <QtGui/QHBoxLayout>
+#include <QtNetwork/QHostAddress>
#include <QtSimulator/connection.h>
#include <QtSimulator/version.h>
#include <QtSimulator/connectionworker.h>
@@ -56,6 +57,7 @@ ExampleApp::ExampleApp(QWidget *parent)
, mConnection(new Connection(Connection::Client, "example", Version(1,0,0,0)))
{
mWorker = mConnection->connectToServer();
+ mWorker->setParent(this);
mWorker->addReceiver(this);
QHBoxLayout *layout = new QHBoxLayout(this);
@@ -66,11 +68,6 @@ ExampleApp::ExampleApp(QWidget *parent)
}
//! [2]
-ExampleApp::~ExampleApp()
-{
- delete mWorker;
-}
-
//! [0]
void ExampleApp::showText(const QString &text)
{
diff --git a/doc/example/application/exampleapp.h b/doc/example/application/exampleapp.h
index 4c929a2..fa57b66 100644
--- a/doc/example/application/exampleapp.h
+++ b/doc/example/application/exampleapp.h
@@ -55,8 +55,7 @@ class ExampleApp : public QWidget
Q_OBJECT
public:
- explicit ExampleApp(QWidget *parent = 0);
- virtual ~ExampleApp();
+ ExampleApp(QWidget *parent = 0);
public slots:
void showText(const QString &);